package com.scott.spring.ch02.service;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * @author 黄后林
 * @version 1.0
 * @date 2021-12-14 13:46:47
 */
@Component
//@Lazy
//@Lazy(true)
@Lazy(value=true)
public class RoleService {
    public RoleService() {
        System.out.println("--------执行RoleService的构造方法--------");
    }

    public int add(int x,int y){
        System.out.println("--------执行#add方法--------");
        return x+y;
    }
}
